using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_ObjectAccessTypeMap : EntityTypeConfiguration<t_ObjectAccessType>
    {
        public t_ObjectAccessTypeMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FObjectType, t.FObjectID, t.FIndex });

            // Properties
            this.Property(t => t.FObjectType)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FObjectID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FIndex)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FName)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.FDescription)
                .HasMaxLength(255);

            this.Property(t => t.FName_cht)
                .HasMaxLength(255);

            this.Property(t => t.FName_en)
                .HasMaxLength(255);

            this.Property(t => t.FDescription_cht)
                .HasMaxLength(255);

            this.Property(t => t.FDescription_en)
                .HasMaxLength(255);

            // Table & Column Mappings
            this.ToTable("t_ObjectAccessType");
            this.Property(t => t.FObjectType).HasColumnName("FObjectType");
            this.Property(t => t.FObjectID).HasColumnName("FObjectID");
            this.Property(t => t.FIndex).HasColumnName("FIndex");
            this.Property(t => t.FAccessMask).HasColumnName("FAccessMask");
            this.Property(t => t.FAccessUse).HasColumnName("FAccessUse");
            this.Property(t => t.FName).HasColumnName("FName");
            this.Property(t => t.FDescription).HasColumnName("FDescription");
            this.Property(t => t.FName_cht).HasColumnName("FName_cht");
            this.Property(t => t.FName_en).HasColumnName("FName_en");
            this.Property(t => t.FDescription_cht).HasColumnName("FDescription_cht");
            this.Property(t => t.FDescription_en).HasColumnName("FDescription_en");
        }
    }
}
